unit frmRegistrarCapUnt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls, DBCtrls;

type
  TfrmRegistrarCap = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Edit2: TEdit;
    Label2: TLabel;
    DateTimePicker1: TDateTimePicker;
    DateTimePicker2: TDateTimePicker;
    Label3: TLabel;
    Label4: TLabel;
    Edit4: TEdit;
    Label6: TLabel;
    Edit5: TEdit;
    Label7: TLabel;
    Edit6: TEdit;
    Label8: TLabel;
    Edit7: TEdit;
    Label9: TLabel;
    BitBtn1: TBitBtn;
    BitBtn4: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure Edit7Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmRegistrarCap: TfrmRegistrarCap;

implementation

uses DMDadosUnt, frmRegistrarCapProcFornUnt;

{$R *.dfm}

procedure TfrmRegistrarCap.BitBtn1Click(Sender: TObject);
begin
  frmRegistrarCapProcForn := TfrmRegistrarCapProcForn.Create(Application);
  frmRegistrarCapProcForn.Show;
end;

procedure TfrmRegistrarCap.Edit7Click(Sender: TObject);
begin
    Edit7.Text := 'R$'+FloatToStr(StrToInt(Edit5.Text)*StrToFloat(Edit6.Text))+',00';
end;

procedure TfrmRegistrarCap.FormCreate(Sender: TObject);
begin
  DateTimePicker1.DateTime := Now;
  DMDados.cdsControle.Close;
  DMDados.cdsControle.Open;
  DMDados.cdsControle.Params[0].AsString := 'COD_CAP';
  Edit1.Text :=IntToStr(DMDados.cdsControleVALOR.AsInteger + 1);
end;

end.
